<template>
	<view class="">
		<c-button type="primary" @click.native="start">
			入场动画
		</c-button>
		<c-button type="warning" @click.native="close">
			退场动画
		</c-button>
		<c-button type="primary" @click.native="start">
			半场动画
		</c-button>
		<c-transition :show="show" 
		custom-class="custom-class"
		enter-class="enter-class"
		enter-active-class="enter-active-class"
		enter-to-class="enter-to-class"
		leave-class="leave-class"
		leave-active-class="leave-active-class"
		leave-to-class="leave-to-class"
		:half="false"
		@halfClose="close"
		:duration="{enter:2000,leave:1000}">666</c-transition>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				show:false
			}
		},
		methods:{
			start:function(){
				this.show = true
			},
			close:function(){
				this.show = false
			}
		}
	}
</script>

<style>
	.custom-class{
	}
	.enter-class,.leave-to-class{
		opacity: 0;
		color: red;
		transform: translateY(100rpx);
	}
	.enter-active-class,.leave-active-class{
		transition-property: opacity,color,transform;
	}
	.enter-to-class{
		opacity: 1;
		transform: translateY(0rpx);
	}
	.leave-class{
		opacity: 1;
		color: green;
	}
</style>
